package ch16_applets_images_sounds;
// JNumberOne.java

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class JNumberOne extends JApplet implements ActionListener
{
  JButton button1 = new JButton("Who's number one?");
  JLabel banner = new JLabel();
  Font bigFont = new Font("TimesRoman",Font.BOLD, 24);

  public void init()
  {
	Container con = getContentPane();
        FlowLayout flow = new FlowLayout();
	con.setLayout(flow);
 	con.add(button1);
 	con.add(banner);
	button1.addActionListener(this);
  }

  public void actionPerformed(ActionEvent e)
  {
      Object source = e.getSource();
      if (source == button1)
      {
          banner.setFont(bigFont);
          banner.setText("Green Bay Packers");
      }
  }
}